//服务层
const mongoose = require("mongoose");
//获得所有
module.exports.getCarousel3 = async () => {
    return await mongoose.model("carouselModel").find();
}

module.exports.getOne3 = async (_id) => {
    return await mongoose.model("carouselModel").find(_id);
}
//更改
module.exports.updateOne3 = async ({ _id,linkto,localsrc,isshow,showorder}) => {
    return await mongoose.model("carouselModel").updateOne({ _id }, {linkto,localsrc,isshow,showorder});
}

//新建
module.exports.addCarousel3 = async (crs) => {
    return await mongoose.model("carouselModel").create(crs);
}

//删除
module.exports.delCarousel3 = async (_id) => {
    return await mongoose.model("carouselModel").deleteOne(_id);
}

